namespace HossMvp.Core
{
    public abstract class AbstractView : IPresentableView<IContentProvider>
    {
        /// <summary>
        /// Gets or sets the contents provider.
        /// </summary>
        /// <value>
        /// The contents provider.
        /// </value>
        public IContentProvider Contents { get; protected set; }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>
        /// The name.
        /// </value>
        public string Name { get; protected set; }

        /// <summary>
        /// Gets or sets the view manager.
        /// </summary>
        /// <value>
        /// The view manager.
        /// </value>
        public AbstractViewManager Manager { get; protected set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractView"/> class.
        /// </summary>
        /// <param name="manager">The manager.</param>
        /// <param name="name">The name.</param>
        /// <param name="contents">The contents.</param>
        protected AbstractView(AbstractViewManager manager, string name, IContentProvider contents)
        {
            this.Manager = manager;
            this.Name = name;
            this.Contents = contents;
        }

        /// <summary>
        /// Binds the commands to form controls.
        /// </summary>
        protected abstract void BindCommands();
    }
}